/* 
 * File:   Super_Man.h
 * Author: Filipp
 *
 * Created on June 13, 2010, 12:50 PM
 */

#ifndef _SUPER_MAN_H
#define	_SUPER_MAN_H

#include "misc.h"
#include <SFML/Graphics.hpp>
#include <string>
#include <sstream>
#include "Menu_Widget.h"

class Super_Man{
public:
	Super_Man(int Width=640, int Height=480);
	int main();
	void printLines(const std::string& lines, float left=0, float top=0);
	void printLines(const std::stringstream& lines, float left=0, float top=0);
	void flipY(bool flip=true);
	const sf::Font& GetFont() const;
	void setBackground(Super_Widget* bg=NULL);
private:


	class InfoWidget : public Text_Widget{
	public:
		InfoWidget(Super_Man* hero);
		void update(); //builds string for info, resizes
		void update(const sf::Input& sfi, float time);
	};


	void initialize();
	void handleEvents();
	void handleKeys();
	void step();
	void draw();
////event helpers////
	void resizeEvent();
	sf::RenderWindow screen;
	sf::View currentView;
	sf::Font font;
	sf::Event event;
	sf::Event::SizeEvent sizeEvent;
	bool needResizing;


	InfoWidget info;
	Super_Widget* background;
};












#endif	/* _SUPER_MAN_H */

